<table class="table table-striped">
    <thead>
    <tr>
        <th>用户ID</th>
        <th>收入类别</th>
        <th>收入金额</th>
        <th>日期</th>
    </tr>
    </thead>
    <tbody>
    {volist name="row" id="row"}
        <tr>
            <td>{$row.user_id}</td>
            <td>{$row.type}</td>
            <td class="amount">{$row.amount}</td>
            <td class="addtime">{$row.add_time|date='Y-m-d',###}</td>
        </tr>

    {/volist}
    <tr>
        <th>总计</th>
        <th id="amounts"></th>
        <th id="addtimes"></th>
    </tr>
    </tbody>
</table>
<div class="hide layer-footer">
    <label class="control-label col-xs-12 col-sm-2"></label>
    <div class="col-xs-12 col-sm-8">
        <button type="reset" class="btn btn-primary btn-embossed btn-close" onclick="Layer.closeAll();">{:__('Close')}</button>
    </div>
</div>
<script src="__PUBLIC__assets/js/jquery-1.11.3.min.js"></script>
<script>
    $(function () {
        var sum=0;
        for(var i=0;i<$(".amount").length;i++){
            sum += parseFloat($(".amount").get(i).innerHTML);
        }

        $('#amounts').text(sum.toFixed(2));

    })

</script>